﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Max.DAL;
using Max.DTO;

namespace Max.BLL
{
    public class UserLogic
    {
        UserModel userModel = new UserModel();

        public bool UserAdd(UserDTO user)
        {
          return userModel.AddUser(UserAssembler.ToEntity(user));       
        }

        public bool UserUpdate(UserDTO user)
        {
            return userModel.UpateUserByUserID(UserAssembler.ToEntity(user));
        }
        
        public UserDTO GetUserByEmail(string email)
        {
            return UserAssembler.ToDTO(userModel.GetUserByEmail(email));
        }

        public UserDTO GetUserByUserId(int userId)
        {
            return UserAssembler.ToDTO(userModel.GetUserByUserID(userId));
        }


        public List<UserDTO> GetAllUsers()
        {
            return UserAssembler.ToDTOs(userModel.GetAllUsers());
        }




    
    }
}
